
package core;

import java.util.ArrayList;
import java.util.HashMap;


/**
 *
 * @author Raed Shomali
 */
public class COINCOMOSubSystem extends COINCOMOUnit
{
    int zoomLevel = 100 ;

    public int getZoomLevel()
    {
        return zoomLevel;
    }

    public void setZoomLevel( int zoomLevel )
    {
        this.zoomLevel = zoomLevel;
    }

    String language = "N/A";

    float laborRate = 0;

    long SLOC = 0;

    float adaptationAdjustmentFactor = 0 ;

    float adaptiveSLOC = 0 ;

    float eaf = 0 ;

    float breakage = 0;

    int sizingType = 0;

    float nomEffort = 0;

    float estEffort = 0;

    float prod = 0;

    float cost = 0;

    float instCost = 0;

    float staff = 0;

    float risk = 0;

    long changeMultiplier = 0;

    long internalLogicalFiles[] = { 0 , 0 , 0 } ;   // Low , Average , High

    long externalInterfaceFiles[] =  { 0 , 0 , 0 } ;  // Low , Average , High

    long externalInputs[] =  { 0 , 0 , 0 } ;  // Low , Average , High

    long externalOutputs[] =  { 0 , 0 , 0 } ;  // Low , Average , High

    long externalInquiries[] =  { 0 , 0 , 0 } ;  // Low , Average , High

    long initialSLOC = 0;

    float designModified = 0;

    float codeModified = 0;

    float integrationModified = 0;

    float softwareUnderstanding = 0;

    float assementAssimilation = 0;

    float unfamiliarity = 0;

    float automaticallyTranslated = 0;

    float autoTranslationProductivity = 0;
    
    String cosysmo_rating[] = new String[14];
    
    float cosysmo_size_reuse[] = new float[72];

    int ratings[] = new int[ 18 ] ;
    int percent[] = new int[ 18 ] ;
    
    
    //Code by Vishesh, Sheryl, Deepak, Ankoor
    String projectName = "";
    
    String projectOrignator = "";
    
    int projectID = 0;
    
    int revNo = 0;
    
    String month = "";
    String day = "";
    String year = "";
    
    String date = "";
    
    double KSLOC = 0;
    double CREVOL = 0;
    
    ArrayList<String> cotsClasses = new ArrayList();
    ArrayList<Integer> cotsClassesId = new ArrayList();
    ArrayList<String> cotsXMLClassess = new ArrayList();
    
    Integer cocot_id;
    
    HashMap<Integer, int[]> cocots_ratings = new HashMap();
    
    //int cocots_rating[] = new int[20];
    
    double projectResult = 0;
    
    //Loaded Cots
    
    HashMap<Integer, int[]> loaded_cocots_ratings = new HashMap();
    
    boolean aggregateLoaded = false;
    
    int numOfTailCots = 0;
    double tailMedianDefault = 0.0;
    
    int numOfInitialAssessCots = 0;
    int numOfFinalAssessCots = 0;
    
    HashMap<Integer, int[]> cocots_assess_ratings = new HashMap();
    HashMap<Integer, int[]> loaded_assess_cocots_ratings = new HashMap();
    
    HashMap<Integer, double[]> cocots_tail_ratings = new HashMap();
    HashMap<Integer, double[]> loaded_tail_cocots_ratings = new HashMap();

    public float getAdaptationAdjustmentFactor()
    {
        return adaptationAdjustmentFactor;
    }

    public void setAdaptationAdjustmentFactor( float adaptationAdjustmentFactor )
    {
        this.adaptationAdjustmentFactor = adaptationAdjustmentFactor;
    }

    public long getAdaptiveSLOC()
    {
        return (long)( adaptiveSLOC * 1000 ) ;
    }

    public long getSLOC()
    {
        return SLOC;
    }

    @Override
    public long getFinalSLOC()
    {
        if( sizingType == 0 )
        {
            return SLOC ;
        }
        else if ( sizingType == 1 )
        {
            return 0 ;
        }
        else
        {
            return (long)( adaptiveSLOC * 1000 - SLOC ) ;
        }
    }

    public void setAdaptiveSLOC( float adaptiveSLOC )
    {
        this.adaptiveSLOC = adaptiveSLOC;
    }

    public void setSLOC( long SLOC )
    {
        this.SLOC = SLOC;
    }

    public float getAssementAssimilation()
    {
        return assementAssimilation;
    }

    public void setAssementAssimilation( float assementAssimilation )
    {
        this.assementAssimilation = assementAssimilation;
    }

    public float getAutoTranslationProductivity()
    {
        return autoTranslationProductivity;
    }

    public void setAutoTranslationProductivity( float autoTranslationProductivity )
    {
        this.autoTranslationProductivity = autoTranslationProductivity;
    }

    public float getAutomaticallyTranslated()
    {
        return automaticallyTranslated;
    }

    public void setAutomaticallyTranslated( float automaticallyTranslated )
    {
        this.automaticallyTranslated = automaticallyTranslated;
    }

    public float getBreakage()
    {
        return breakage;
    }

    public void setBreakage( float breakage )
    {
        this.breakage = breakage;
    }

    public long getChangeMultiplier()
    {
        return changeMultiplier;
    }

    public void setChangeMultiplier( long changeMultiplier )
    {
        this.changeMultiplier = changeMultiplier;
    }

    public float getCodeModified()
    {
        return codeModified;
    }

    public void setCodeModified( float codeModified )
    {
        this.codeModified = codeModified;
    }

    @Override
    public float getCost()
    {
        return cost;
    }

    public void setCost( float cost )
    {
        this.cost = cost;
    }

    public float getDesignModified()
    {
        return designModified;
    }

    public void setDesignModified( float designModified )
    {
        this.designModified = designModified;
    }

    public float getEstEffort()
    {
        return estEffort;
    }

    public void setEstEffort( float estEffort )
    {
        this.estEffort = estEffort;
    }

    public long getInitialSLOC()
    {
        return initialSLOC;
    }

    public void setInitialSLOC( long initialSLOC )
    {
        this.initialSLOC = initialSLOC;
    }

    public float getInstCost()
    {
        return instCost;
    }

    public void setInstCost( float instCost )
    {
        this.instCost = instCost;
    }

    public float getIntegrationModified()
    {
        return integrationModified;
    }

    public void setIntegrationModified( float integrationModified )
    {
        this.integrationModified = integrationModified;
    }

    public float getLaborRate()
    {
        return laborRate;
    }

    public void setLaborRate( float laborRate )
    {
        this.laborRate = laborRate;
    }

    public String getLanguage()
    {
        return language;
    }

    public void setLanguage( String language )
    {
        this.language = language;
    }

    public float getNomEffort()
    {
        return nomEffort;
    }

    public void setNomEffort( float nomEffort )
    {
        this.nomEffort = nomEffort;
    }

    public float getProd()
    {
        return prod;
    }

    public void setProd( float prod )
    {
        this.prod = prod;
    }

    public float getRisk()
    {
        return risk;
    }

    public void setRisk( float risk )
    {
        this.risk = risk;
    }

    public int getSizingType()
    {
        return sizingType;
    }

    public void setSizingType( int sizingType )
    {
        this.sizingType = sizingType;
    }

    public float getSoftwareUnderstanding()
    {
        return softwareUnderstanding;
    }

    public void setSoftwareUnderstanding( float softwareUnderstanding )
    {
        this.softwareUnderstanding = softwareUnderstanding;
    }

    @Override
    public float getStaff()
    {
        return staff;
    }

    public void setStaff( float staff )
    {
        this.staff = staff;
    }

    public float getUnfamiliarity()
    {
        return unfamiliarity;
    }

    public void setUnfamiliarity( float unfamiliarity )
    {
        this.unfamiliarity = unfamiliarity;
    }

    public int[] getPercent()
    {
        return percent;
    }

    public void setPercent( int[] percent )
    {
        this.percent = percent;
    }

    public int[] getRatings()
    {
        return ratings;
    }

    public void setRatings( int[] ratings )
    {
        this.ratings = ratings;
    }

    public float getEaf()
    {
        return eaf;
    }

    public void setEaf( float eaf )
    {
        this.eaf = eaf;
    }

    public long[] getExternalInputs()
    {
        return externalInputs;
    }

    public void setExternalInputs( long[] externalInputs )
    {
        this.externalInputs = externalInputs;
    }

    public long[] getExternalInquiries()
    {
        return externalInquiries;
    }

    public void setExternalInquiries( long[] externalInquiries )
    {
        this.externalInquiries = externalInquiries;
    }

    public long[] getExternalInterfaceFiles()
    {
        return externalInterfaceFiles;
    }

    public void setExternalInterfaceFiles( long[] externalInterfaceFiles )
    {
        this.externalInterfaceFiles = externalInterfaceFiles;
    }

    public long[] getExternalOutputs()
    {
        return externalOutputs;
    }

    public void setExternalOutputs( long[] externalOutputs )
    {
        this.externalOutputs = externalOutputs;
    }

    public long[] getInternalLogicalFiles()
    {
        return internalLogicalFiles;
    }

    public void setInternalLogicalFiles( long[] internalLogicalFiles )
    {
        this.internalLogicalFiles = internalLogicalFiles;
    }
    
    //Arnab ..................
    public void setCosysmoRatings( String ratings[] )
    {
        this.cosysmo_rating = ratings;
    }
    public String[] getCosysmoRatings()
    {
        return cosysmo_rating;
    }
     float cosysmo_size_nonreuse[] = new float[12];
    
    public float[] get_size_param_nonreuse()
    {
        return cosysmo_size_nonreuse;
    }
    
    public void set_size_param_nonreuse( float[] size_val )
    {
        this.cosysmo_size_nonreuse = size_val;
    }
    public float[] get_size_param_reuse()
    {
        return cosysmo_size_reuse;
    }
    
    public void set_size_param_reuse( float[] size_val )
    {
        this.cosysmo_size_reuse = size_val;
    }
    
    //Vishesh, Sheryl, Deepak, Ankoor...........
    /*public void setCocotsRatings( int ratings[] )
    {
    	this.cocots_rating = ratings;
    }*/
    public void setProjectName( String projectName )
    {
    	this.projectName = projectName;
    }
    public String getProjectName()
    {
    	return projectName;
    }
    public void setProjectOriginator( String projectOriginator ) 
    {
    	this.projectOrignator = projectOriginator;
    }
    
    public String getProjectOriginator()
    {
    	return projectOrignator;
    }
    
    public void setProjectID( int projectID )
    {
    	this.projectID = projectID;
    }
    public int getProjectID()
    {
    	return projectID;
    }
    
    
    public void setProjectRevNo( int revNo ) 
    {
    	this.revNo = revNo;
    }
    
    public int getProjectRevNo()
    {
    	return revNo;
    }
    
    public void setKSLOC ( double KSLOC )
    {
    	this.KSLOC = KSLOC;
    }
    public double getKSLOC ()
    {
    	return KSLOC;
    }
    public void setCREVOL ( double CREVOL )
    {
    	this.CREVOL = CREVOL;
    }
    public double getCREVOL ()
    {
    	return CREVOL;
    }
    public void setDateString(String date)
    {
    	this.date = date;
    }
    public void setDate( String year, String month, String day )
    {
    	this.month = month;
    	this.day = day;
    	this.year = year;
    }
    public String getDateString()
    {
    	return date;
    }
    public String getDate()
    {
    	return year + "-" + month + "-" + day;
    }
    public void clearCotClass()
    {
    	cotsXMLClassess = (ArrayList<String>) cotsClasses.clone();
    	cotsClasses.clear();
    	cocots_ratings.clear();
    	cotsClassesId.clear();
    }
    
    public void setAdditionalCotClassID( Integer cotClass )
    {
    	this.cotsClassesId.add(cotClass);
    }
    public void setAdditionalCotClass( String cotClass)
    {
    	this.cotsClasses.add(cotClass);
    }
    
    public void removeAdditionalCotClassID( Integer cotClass )
    {
    	this.cotsClassesId.remove(cotClass);
    }
    public void removeAdditionalCotClass( String cotClass)
    {
    	this.cotsClasses.remove(cotClass);
    }
    
    public ArrayList<String> getCotClass()
    {
    	return cotsClasses;
    }
    
    public ArrayList<String> getXMLCotClass()
    {
    	return cotsXMLClassess;
    }
    
    public ArrayList<Integer> getCotClassID()
    {
    	return cotsClassesId;
    }
    
    public void setCocotID( Integer id )
    {
    	this.cocot_id = id;
    }
    public Integer getCoCotID ()
    {
    	return cocot_id;
    }
    //Glue Code Ratings
    
    
    public HashMap< Integer, int [] > getCocotsRatings()
    {
    	return cocots_ratings;
    }
    public void setCocotsRatings( Integer cocot_id , int[] rating)
    {
    	this.cocots_ratings.put(cocot_id, rating);
    }
    //Tail Code Ratings
    
    public void setNumOfTailCots ( int numOfTailCots )
    {
    	this.numOfTailCots = numOfTailCots;
    }
    
    public int getNumOfTailCots ()
    {
    	return numOfTailCots;
    }
    
    public void setTailMedianDefault(double tailMedianDefault) 
	{
		this.tailMedianDefault = tailMedianDefault;
	}
    
	public double getTailMedianDefault()
	{
		return tailMedianDefault;
	}
    
    
    public HashMap< Integer, double[] > getTailCocotsRatings()
    {
    	return cocots_tail_ratings;
    }
    public void setTailCocotsRatings( Integer cocot_id , double[] ratings)
    {
    	this.cocots_tail_ratings.put(cocot_id, ratings);
    }
    
    
   //Asses Code Ratings
    
    public void setNumOfIntialAssessCots ( int numOfIntialAssessCots )
    {
    	this.numOfInitialAssessCots = numOfIntialAssessCots;
    }
    
    public int getNumOfIntialAssessCots ()
    {
    	return numOfInitialAssessCots;
    }
    
    public void setNumOfFinalAssessCots ( int numOfFinalAssessCots )
    {
    	this.numOfFinalAssessCots = numOfFinalAssessCots;
    }
    
    public int getNumOfFinalAssessCots ()
    {
    	return numOfFinalAssessCots;
    }
    
    
    public HashMap< Integer, int [] > getAssessCocotsRatings()
    {
    	return cocots_assess_ratings;
    }
    public void setAssessCocotsRatings( Integer cocot_id , int[] rating)
    {
    	this.cocots_assess_ratings.put(cocot_id, rating);
    }
    
    
    
    
    public void setProjectResult ( double projectResult )
    {
    	this.projectResult = projectResult;
    }
    
    public double getProjectResult ()
    {
    	return projectResult;
    }
    
    //Loaded Cots
    
    
    //Glue Code
    public void setLoadedCocotRatings( Integer cocot_id , int[] rating )
    {
    	this.loaded_cocots_ratings.put(cocot_id, rating);
    }
    
    public HashMap< Integer, int [] > getLoadedCocotsRatings()
    {
    	return loaded_cocots_ratings;
    }
    
    public void deleteLoadedCocotsRatings ( Integer cocot_id )
    {
    	loaded_cocots_ratings.remove( cocot_id );
    }
    
    public void clearLoadedCocotsRatings ()
    {
    	loaded_cocots_ratings.clear();
    }
    
    //Tail Code
    public void setLoadedTailCocotRatings( Integer cocot_id , double[] rating )
    {
    	this.loaded_tail_cocots_ratings.put(cocot_id, rating);
    }
    
    public HashMap< Integer, double[] > getLoadedTailCocotsRatings()
    {
    	return loaded_tail_cocots_ratings;
    }
    
    public void deleteLoadedTailCocotsRatings ( Integer cocot_id )
    {
    	loaded_tail_cocots_ratings.remove( cocot_id );
    }
    
    public void clearLoadedTailCocotsRatings ()
    {
    	loaded_tail_cocots_ratings.clear();
    }
    
    //Assess Code
    public void setLoadedAssessCocotRatings( Integer cocot_id , int[] rating )
    {
    	this.loaded_assess_cocots_ratings.put(cocot_id, rating);
    }
    
    public HashMap< Integer, int [] > getLoadedAssessCocotsRatings()
    {
    	return loaded_assess_cocots_ratings;
    }
    
    public void deleteLoadedAssessCocotsRatings ( Integer cocot_id )
    {
    	loaded_assess_cocots_ratings.remove( cocot_id );
    }
    
    public void clearLoadedAssessCocotsRatings ()
    {
    	loaded_assess_cocots_ratings.clear();
    }
    
    
    public void setAggregateLoaded()
    {
    	aggregateLoaded = true;
    }
    
    public boolean getAggregateLoaded()
    {
    	return aggregateLoaded;
    }

	
    
}
